package com.lsa.letcode.the147.insertionSortList;

import org.junit.Test;

import com.lsa.letcode.common.LetCodeTestBase;

public class InsertionSortListTest extends LetCodeTestBase {
	@Test
	public void test() throws Exception {
		Solution s = new Solution();
		assertEqual(asList(1, 2, 3, 4, 5), s.sortList(asList(5, 3, 2, 1, 4)));
		assertEqual(asList(1, 2, 3, 4, 5), s.sortList(asList(1, 2, 3, 4, 5)));
		assertEqual(asList(1, 2, 3, 4, 5), s.sortList(asList(5, 4, 3, 2, 1)));
		assertEqual(asList(1, 2, 3, 4, 5, 6, 7),
				s.sortList(asList(7, 1, 6, 2, 5, 3, 4)));
		assertEqual(asList(1, 1, 2, 3, 4, 5, 6, 7),
				s.sortList(asList(7, 1, 6, 2, 5, 3, 4, 1)));
		assertEqual(asList(1, 2, 3, 4, 5, 6, 7, 7),
				s.sortList(asList(7, 7, 1, 6, 2, 5, 3, 4)));
		assertEqual(asList(1, 2, 3, 4, 4, 4, 5, 6, 7),
				s.sortList(asList(4, 7, 1, 4, 6, 2, 5, 3, 4)));
		assertEqual(asList(1, 2, 3, 4), s.sortList(asList(3, 1, 2, 4)));
		assertEqual(asList(1, 2, 3), s.sortList(asList(3, 1, 2)));
		assertEqual(asList(1, 2), s.sortList(asList(2, 1)));
		assertEqual(asList(1,1,1,1), s.sortList(asList(1,1,1,1)));
		assertEqual(asList(1), s.sortList(asList(1)));
	}
}
